package com.qf.security1.mapper;

import com.qf.security1.pojo.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    @Select("select * from user where username=#{username}")
    User findByUsername(String username);

    @Select("SELECT r.rname\n" +
            "FROM USER u,user_roles ur,roles r\n" +
            "WHERE u.id=ur.uid AND ur.rid=r.id\n" +
            "\tAND username=#{username}")
    List<String> findRoleNamesByUsername(String username);
}
